create table jms_dm.dm_cusc_tyd_taking_waybill_detail_dt
(
    id                   varchar(100) comment '订单编号',
    waybill_id           varchar(100) comment '运单号',
    proxy_area_code      varchar(100) comment '代理区code',
    pick_network_code    varchar(100) comment '取件网点code',
    customer_code        varchar(100) comment '客户编号code',
    proxy_area_name      varchar(100) comment '代理区名称',
    pick_network_name    varchar(100) comment '取件网点名称',
    sender_province_id   varchar(100) comment '寄件省份id',
    sender_province_name varchar(100) comment '寄件省份名称',
    sender_city_id       varchar(100) comment '寄件城市名id',
    sender_city_name     varchar(100) comment '寄件城市名',
    customer_name        varchar(100) comment '客户编号名称',
    order_source_code    varchar(100) comment '订单来源code',
    order_source_name    varchar(100) comment '订单来源名称',
    order_status_code    int comment '订单状态code 剔除已取消订单104,已取件对应103',
    input_time           varchar(100) comment '订单录入时间',
    date_time            date comment '日期'
) ENGINE = OLAP DUPLICATE KEY(id, waybill_id, proxy_area_code,pick_network_code,customer_code)
COMMENT "兔优达揽收-明细"
PARTITION BY RANGE(date_time)
(START ("2022-08-15") END ("2022-09-15") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(id) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);
